/**
 * 
 */
package org.dragonfire.editor.syntax.rules.tibasic;

import java.util.ArrayList;

import org.dragonfire.editor.syntax.rules.KeywordRule;
import org.eclipse.jface.text.rules.ICharacterScanner;
import org.eclipse.jface.text.rules.IToken;
import org.eclipse.jface.text.rules.Token;

/**
 * @author Darth Android
 * @date Dec 28, 2007
 */
public class TIBasicColumnKeywordRule extends KeywordRule {

	/**
	 * @param keywords
	 */
	public TIBasicColumnKeywordRule(ArrayList<String> keywords, int beginColumn) {
		super(keywords);
	}

	/**
	 * @param keywords
	 * @param attributeName
	 */
	public TIBasicColumnKeywordRule(ArrayList<String> keywords, int beginColumn, String attributeName) {
		super(keywords, attributeName);
	}

	/**
	 * @param keywords
	 */
	public TIBasicColumnKeywordRule(String[] keywords, int beginColumn) {
		super(keywords);
	}

	public IToken evaluate(ICharacterScanner scanner) {
		if (scanner.getColumn() > 0) {
			scanner.unread();
			int prev = scanner.read();
			if (prev != ':')
				return Token.UNDEFINED;
			return super.evaluate(scanner);
		}
		else
			return super.evaluate(scanner);
	}
}
